package com.heima.user.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.heima.model.common.dtos.PageRequestDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.UserAuthenticationDto;
import com.heima.user.service.UserAuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: fly
 * @date: 2024-08-01 10:08
 */
@RestController
@RequestMapping("/api/v1/auth")
public class UserAuthenticationController {

    @Autowired
    private UserAuthenticationService userAuthenticationService;

    /**
     * 分页条件查询认证列表
     *
     * @param dto
     * @return
     */
    @PostMapping("/list")
    public ResponseResult list(@RequestBody UserAuthenticationDto dto) {
        return userAuthenticationService.pageList(dto);
    }

    /**
     * 审核通过
     * @param dto
     * @return
     */
    @PostMapping("/authPass")
    public ResponseResult authPass(@RequestBody UserAuthenticationDto dto){
        return userAuthenticationService.authPass(dto);
    }

    /**
     * 拒绝
     * @param dto
     * @return
     */
    @PostMapping("/authFail")
    public ResponseResult authFail(@RequestBody UserAuthenticationDto dto){
        return userAuthenticationService.authFail(dto);
    }
}
